Table of Contents

Module: DataModel .\src\TW\Database\DataModel.py

Components for database record handling, caching, etc.

Example usage:

        class myDatabase(DataModel.Database):

            class Family1(DataModel.TypeManager):

                class SomeTypeA1(DataModel.RecordType):
                    allKeys = (
                        ('primary_key',),
                        ('secondary_key_field1','secondary_key_field2'),
                        ...
                    )

                class SomeTypeB1(SomeTypeA1):
                    ...

                class SomeTypeC1(DataModel.RecordType):
                    ...

            class Family2(DataModel.TypeManager):
                ...

You may nest as many families in a database as you want, and as many record types in a family as you want. All record types in a family share the same class for record objects, and the same record cache, indexed by their combined key fields. Record types may derive from one another, within the same type family.

Imported modules   
from TW.API import *
from TW.Callbacks import CallbackList
from TW.Database.Interfaces import *, __all__
from kjbuckets import *
from weakref import WeakValueDictionary
Classes   
Database

A database; handles update queue and transactions

Record

A record of a RecordType; handles field read/write

RecordType

A kind of database record; knows how to load/save/query

SimpleTypeManager

A TypeManager+RecordType combo for type families w/only one type

TypeManager

A family of similar recordtypes; handles caching


Table of Contents

This document was automatically generated on Tue Mar 05 10:33:44 2002 by HappyDoc version WORKING